package com.barney.support.jpa;

import javax.persistence.PostLoad;

import com.barney.support.domain.HasPostLoad;

/**
 * 엔티티를 로드한 이후 특정 메소드를 실행하는 엔티티 리스너.
 *
 * <blockquote><pre>
 * &#064;Entity
 * &#064;EntityListeners(PostLoadListener.class)
 * pubic class Entity implements Serializable, HasPostLoad {
 * ...
 * }
 * </pre></blockquote>
 *
 * @see HasPostLoad
 */
public class PostLoadListener {

	@PostLoad
	public void postLoad(Object obj) {
		if(obj instanceof HasPostLoad) {
			((HasPostLoad)obj).postLoad();
		}
	}
}
